<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('智慧校园-考试安排打印')" />
</head>
<style>
    .input_line{
        border-bottom: 1px solid #000;
        border-top: 0px;
        border-left: 0px;
        border-right: 0px;
        outline: none;
    }
</style>
<body class="white-bg " >
<div class="navbar navbar-inverse navbar-fixed-top ">
    <div class="container-fluid">
        <button class="fa fa-print btn btn-primary btn-sm " onclick="print()">打印</button>
    </div>
</div>
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="print_content" style="margin-top: 18px;">
        <form class="form-horizontal m" id="course_schedule_print">
<!--            <div class="form-group">-->
<!--                <div class="col-sm-12 m-auto text-center">-->
<!--                    <h3>[[${schedule.name}]]</h3>-->
<!--                </div>-->
<!--            </div>-->

            <div class="form-group" th:each="w0,iterStat : ${list}">
                <div class="col-sm-12 m-auto">
                    <h4 class="text-center" th:text="${w0.scheduleName + '---'+ w0.typeName }"></h4>
                    <div class="table-striped table-bordered">
                        <table th:id="'bootstrap-table'+${iterStat.index}"></table>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:src="@{/jasonday-printThis/printThis.js}"></script>
    <script th:inline="javascript">

        var list2 = [[${list}]];

        var options = {
            columns: [
                {
                    field: 'site0',
                    title: '座位号',
                    width:60
                },
                {
                    field: 'studentNo0',
                    title: '学号',
                },
                {
                    field: 'studentName0',
                    title: '姓名',
                    width:80
                },
                {
                    field: 'site1',
                    title: '座位号',
                    width:60
                },
                {
                    field: 'studentNo1',
                    title: '学号',
                },
                {
                    field: 'studentName1',
                    title: '姓名',
                    width:80
                },
            ],
            data:[]
        }

        $(()=>{
            for(let i=0;i<list2.length;i++){
                let id = "#bootstrap-table"+i;
                $(id).bootstrapTable(options);
                $(id).bootstrapTable('load',list2[i].list);
            }
        })

        function print(){
            $("#print_content").printThis();
        }

    </script>
</body>
</html>